<template>
	<view class="list">
		<u-cell-group>
			<u-cell-item bg-color='#FFF8E6' @click='toPage("history")'>
				<u-icon slot="icon" size="32" name="clock" color="#ffad37"></u-icon>
				<text slot="title" style="margin-left: 10rpx;">历史挂号</text>
			</u-cell-item>
			<u-cell-item v-for="(item, i) in data" :title="item.deptName" :key='i' @click='toPage(item)'></u-cell-item>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		props:{
			data:{
				type:Array,
				default:() => {
					return []
				}
			},
			code:{
				type:String,
				default:''
			}
		},
		methods:{
			toPage(val){
				if(val==='history'){
					uni.navigateTo({
						url:'/pages/Personal/MyDoctor/index'
					})
				}else{
					uni.navigateTo({
						url:'/pages/registerPblist/index?deptCode='+val.deptCode
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list{
		// padding: 0 30rpx;
		.list-history{
			.u-cell{
				background-color: #FFF8E6;
			}
		}
	}
</style>
